package com.ww.scm.valueObject.mat;

import java.util.ArrayList;
import java.util.List;

import com.ww.scm.constants.Constants;
import com.ww.scm.entity.mat.Bill;
import com.ww.scm.entity.mat.Transaction;
import com.ww.scm.entity.mat.TransactionDetail;
import com.ww.scm.entity.pub.Dictionary;
import com.ww.scm.valueObject.ValueObject;


public class BillVo extends ValueObject{
	
	
	private String billCode; //单据编号
	private String billTypeId; //单据类型
	private String billTypeName; //单据类型
	private String billDate; //单据日期
	private String operator;// 填报人
	private String fillTime;// 填报时间
	private String transactionId; // 事物主键
	private String transactionTypeId; //事物类型
	private String originEntityId;//源位置ID
	private String originEntityName;//源位置名称
	private String targetEntityId;//目标位置ID
	private String targetEntityName;//目标位置ID	
	
	
	private String otherDic1Id;
	private String otherDic1Name; 
	private String otherDic2Id;
	private String otherDic2Name;
	private String otherDic3Id;
	private String otherDic3Name;
	private String otherDic4Id;
	private String otherDic4Name;
	private String otherDic5Id;
	private String otherDic5Name;
	private String otherDic6Id;
	private String otherDic6Name;
	private String otherDic7Id;
	private String otherDic7Name;
	private String otherDic8Id;
	private String otherDic8Name;
	private String otherDic9Id;
	private String otherDic9Name;
	private String otherDic10Id;
	private String otherDic10Name;
	
	private String value1;
	private String value2;
	private String value3;
	private String value4;
	private String value5;
	private String value6;
	private String value7;
	private String value8;
	private String value9;
	private String value10;
	
	private Double double1;
	private Double double2;
	private Double double3;
	private Double double4;
	private Double double5;
	private Double double6;
	private Double double7;
	private Double double8;
	private Double double9;
	private Double double10;
	
	private List<BillDetailVo> billDetailVo=new ArrayList<BillDetailVo>();

	public BillVo() {
	}

	public BillVo(Bill bill) {
		super(bill);
		this.billCode=bill.getBillCode();
		this.billDate=bill.getBillDate();  
		Dictionary billType=bill.getBillType();
		if (billType!=null){
			this.billTypeId=billType.getId();
			this.billTypeName=billType.getName();
		}
		this.operator=bill.getOperator();
		this.fillTime=bill.getFillTime();
		Transaction transaction=bill.getLastTransaction();
		this.transactionId=transaction.getId();
		this.transactionTypeId=transaction.getType();
		Dictionary originEntity=bill.getOriginEntity();
		if (originEntity!=null){
			this.originEntityId=originEntity.getId();
			this.originEntityName=originEntity.getName();
		}
		Dictionary targetEntity=bill.getTargetEntity();
		if (targetEntity!=null){
			this.targetEntityId=targetEntity.getId();
			this.targetEntityName=targetEntity.getName();
		}
		
		Dictionary otherDic1 = bill.getOtherDic1();
		if(otherDic1!=null){
			this.otherDic1Id=otherDic1.getId();
			this.otherDic1Name=otherDic1.getName();
		}
		Dictionary otherDic2 = bill.getOtherDic2();
		if(otherDic2!=null){
			this.otherDic2Id=otherDic2.getId();
			this.otherDic2Name=otherDic2.getName();
		}
		Dictionary otherDic3 = bill.getOtherDic3();
		if(otherDic3!=null){
			this.otherDic3Id=otherDic3.getId();
			this.otherDic3Name=otherDic3.getName();
		}
		Dictionary otherDic4 = bill.getOtherDic4();
		if(otherDic4!=null){
			this.otherDic4Id=otherDic4.getId();
			this.otherDic4Name=otherDic4.getName();
		}
		Dictionary otherDic5 = bill.getOtherDic5();
		if(otherDic5!=null){
			this.otherDic5Id=otherDic5.getId();
			this.otherDic5Name=otherDic5.getName();
		}
		Dictionary otherDic6 = bill.getOtherDic6();
		if(otherDic6!=null){
			this.otherDic6Id=otherDic6.getId();
			this.otherDic6Name=otherDic6.getName();
		}
		Dictionary otherDic7 = bill.getOtherDic1();
		if(otherDic1!=null){
			this.otherDic7Id=otherDic7.getId();
			this.otherDic7Name=otherDic7.getName();
		}
		Dictionary otherDic8 = bill.getOtherDic8();
		if(otherDic8!=null){
			this.otherDic8Id=otherDic8.getId();
			this.otherDic8Name=otherDic8.getName();
		}
		Dictionary otherDic9 = bill.getOtherDic9();
		if(otherDic9!=null){
			this.otherDic9Id=otherDic9.getId();
			this.otherDic9Name=otherDic9.getName();
		}
		Dictionary otherDic10 = bill.getOtherDic10();
		if(otherDic10!=null){
			this.otherDic10Id=otherDic10.getId();
			this.otherDic10Name=otherDic10.getName();
		}
		
		this.value1=bill.getValue1();
		this.value2=bill.getValue2();
		this.value3=bill.getValue3();
		this.value4=bill.getValue4();
		this.value5=bill.getValue5();
		this.value6=bill.getValue6();
		this.value7=bill.getValue7();
		this.value8=bill.getValue8();
		this.value9=bill.getValue9();
		this.value10=bill.getValue10();
		
		this.double1=bill.getDouble1();
		this.double2=bill.getDouble2();
		this.double3=bill.getDouble3();
		this.double4=bill.getDouble4();
		this.double5=bill.getDouble5();
		this.double6=bill.getDouble6();
		this.double7=bill.getDouble7();
		this.double8=bill.getDouble8();
		this.double9=bill.getDouble9();
		this.double10=bill.getDouble10();
	}
	
	public void renderBillDetailVo(Bill bill) {
		Transaction lastTransaction=bill.getLastTransaction();
		for (TransactionDetail transactionDetail : lastTransaction.getTransactionDetail()) {
			if (Constants.SYS_FLAG_DELETED.equals(transactionDetail.getSysFlag())){
				continue;
			}
			billDetailVo.add(new BillDetailVo(transactionDetail));
		}
		
	}

	public void addBillDetail(BillDetailVo billDetail) {
		this.billDetailVo.add(billDetail);
	}

	public String getBillCode() {
		return billCode;
	}

	public String getBillTypeId() {
		return billTypeId;
	}

	public String getBillTypeName() {
		return billTypeName;
	}

	public String getBillDate() {
		return billDate;
	}

	public String getOperator() {
		return operator;
	}

	public String getFillTime() {
		return fillTime;
	}

	public String getTransactionId() {
		return transactionId;
	}

	public String getTransactionTypeId() {
		return transactionTypeId;
	}

	public String getOriginEntityId() {
		return originEntityId;
	}

	public String getOriginEntityName() {
		return originEntityName;
	}

	public String getTargetEntityId() {
		return targetEntityId;
	}

	public String getTargetEntityName() {
		return targetEntityName;
	}

	public String getOtherDic1Id() {
		return otherDic1Id;
	}

	public String getOtherDic1Name() {
		return otherDic1Name;
	}

	public String getOtherDic2Id() {
		return otherDic2Id;
	}

	public String getOtherDic2Name() {
		return otherDic2Name;
	}

	public String getOtherDic3Id() {
		return otherDic3Id;
	}

	public String getOtherDic3Name() {
		return otherDic3Name;
	}

	public String getOtherDic4Id() {
		return otherDic4Id;
	}

	public String getOtherDic4Name() {
		return otherDic4Name;
	}

	public String getOtherDic5Id() {
		return otherDic5Id;
	}

	public String getOtherDic5Name() {
		return otherDic5Name;
	}

	public String getOtherDic6Id() {
		return otherDic6Id;
	}

	public String getOtherDic6Name() {
		return otherDic6Name;
	}

	public String getOtherDic7Id() {
		return otherDic7Id;
	}

	public String getOtherDic7Name() {
		return otherDic7Name;
	}

	public String getOtherDic8Id() {
		return otherDic8Id;
	}

	public String getOtherDic8Name() {
		return otherDic8Name;
	}

	public String getOtherDic9Id() {
		return otherDic9Id;
	}

	public String getOtherDic9Name() {
		return otherDic9Name;
	}

	public String getOtherDic10Id() {
		return otherDic10Id;
	}

	public String getOtherDic10Name() {
		return otherDic10Name;
	}
	
	public String getValue1() {
		return value1;
	}
	
	public String getValue2() {
		return value2;
	}

	public String getValue3() {
		return value3;
	}

	public String getValue4() {
		return value4;
	}

	public String getValue5() {
		return value5;
	}

	public String getValue6() {
		return value6;
	}

	public String getValue7() {
		return value7;
	}

	public String getValue8() {
		return value8;
	}

	public String getValue9() {
		return value9;
	}

	public String getValue10() {
		return value10;
	}

	public Double getDouble1() {
		return double1;
	}
	
	public Double getDouble2() {
		return double2;
	}
	
	public Double getDouble3() {
		return double3;
	}
	
	public Double getDouble4() {
		return double4;
	}
	
	public Double getDouble5() {
		return double5;
	}
	
	public Double getDouble6() {
		return double6;
	}
	
	public Double getDouble7() {
		return double7;
	}
	
	public Double getDouble8() {
		return double8;
	}
	
	public Double getDouble9() {
		return double9;
	}
	
	public Double getDouble10() {
		return double10;
	}

	public List<BillDetailVo> getBillDetailVo() {
		return billDetailVo;
	}

	public void setBillCode(String billCode) {
		this.billCode = billCode;
	}

	public void setBillTypeId(String billTypeId) {
		this.billTypeId = billTypeId;
	}

	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}

	public void setBillDate(String billDate) {
		this.billDate = billDate;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public void setFillTime(String fillTime) {
		this.fillTime = fillTime;
	}

	public void setTransactionId(String transactionId) {
		this.transactionId = transactionId;
	}

	public void setTransactionTypeId(String transactionTypeId) {
		this.transactionTypeId = transactionTypeId;
	}

	public void setOriginEntityId(String originEntityId) {
		this.originEntityId = originEntityId;
	}

	public void setOriginEntityName(String originEntityName) {
		this.originEntityName = originEntityName;
	}

	public void setTargetEntityId(String targetEntityId) {
		this.targetEntityId = targetEntityId;
	}

	public void setTargetEntityName(String targetEntityName) {
		this.targetEntityName = targetEntityName;
	}

	public void setOtherDic1Id(String otherDic1Id) {
		this.otherDic1Id = otherDic1Id;
	}

	public void setOtherDic1Name(String otherDic1Name) {
		this.otherDic1Name = otherDic1Name;
	}

	public void setOtherDic2Id(String otherDic2Id) {
		this.otherDic2Id = otherDic2Id;
	}

	public void setOtherDic2Name(String otherDic2Name) {
		this.otherDic2Name = otherDic2Name;
	}

	public void setOtherDic3Id(String otherDic3Id) {
		this.otherDic3Id = otherDic3Id;
	}

	public void setOtherDic3Name(String otherDic3Name) {
		this.otherDic3Name = otherDic3Name;
	}

	public void setOtherDic4Id(String otherDic4Id) {
		this.otherDic4Id = otherDic4Id;
	}

	public void setOtherDic4Name(String otherDic4Name) {
		this.otherDic4Name = otherDic4Name;
	}

	public void setOtherDic5Id(String otherDic5Id) {
		this.otherDic5Id = otherDic5Id;
	}

	public void setOtherDic5Name(String otherDic5Name) {
		this.otherDic5Name = otherDic5Name;
	}

	public void setOtherDic6Id(String otherDic6Id) {
		this.otherDic6Id = otherDic6Id;
	}

	public void setOtherDic6Name(String otherDic6Name) {
		this.otherDic6Name = otherDic6Name;
	}

	public void setOtherDic7Id(String otherDic7Id) {
		this.otherDic7Id = otherDic7Id;
	}

	public void setOtherDic7Name(String otherDic7Name) {
		this.otherDic7Name = otherDic7Name;
	}

	public void setOtherDic8Id(String otherDic8Id) {
		this.otherDic8Id = otherDic8Id;
	}

	public void setOtherDic8Name(String otherDic8Name) {
		this.otherDic8Name = otherDic8Name;
	}

	public void setOtherDic9Id(String otherDic9Id) {
		this.otherDic9Id = otherDic9Id;
	}

	public void setOtherDic9Name(String otherDic9Name) {
		this.otherDic9Name = otherDic9Name;
	}

	public void setOtherDic10Id(String otherDic10Id) {
		this.otherDic10Id = otherDic10Id;
	}

	public void setOtherDic10Name(String otherDic10Name) {
		this.otherDic10Name = otherDic10Name;
	}
	
	public void setValue1(String value1) {
		this.value1 = value1;
	}
	
	public void setValue2(String value2) {
		this.value2 = value2;
	}

	public void setValue3(String value3) {
		this.value3 = value3;
	}

	public void setValue4(String value4) {
		this.value4 = value4;
	}

	public void setValue5(String value5) {
		this.value5 = value5;
	}

	public void setValue6(String value6) {
		this.value6 = value6;
	}

	public void setValue7(String value7) {
		this.value7 = value7;
	}

	public void setValue8(String value8) {
		this.value8 = value8;
	}

	public void setValue9(String value9) {
		this.value9 = value9;
	}

	public void setValue10(String value10) {
		this.value10 = value10;
	}
	
	public void setDouble1(Double double1) {
		this.double1 = double1;
	}

	public void setDouble2(Double double2) {
		this.double2 = double2;
	}
	
	public void setDouble3(Double double3) {
		this.double3 = double3;
	}
	public void setDouble4(Double double4) {
		this.double4 = double4;
	}
	
	public void setDouble5(Double double5) {
		this.double5 = double5;
	}
	
	public void setDouble6(Double double6) {
		this.double6 = double6;
	}
	
	public void setDouble7(Double double7) {
		this.double7 = double7;
	}
	
	public void setDouble8(Double double8) {
		this.double8 = double8;
	}
	
	public void setDouble9(Double double9) {
		this.double9 = double9;
	}
	
	public void setDouble10(Double double10) {
		this.double10 = double10;
	}

	public void setBillDetailVo(List<BillDetailVo> billDetailVo) {
		this.billDetailVo = billDetailVo;
	}




}
